import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {
    constructor() {
        super();
        
    }
    render() {
      console.log(this.props.qqq)
        return <div className={this.props.className}>
            年龄:{this.props.age}
        </div>;
    }
}
// 高阶
function connect(obj){
  return function(Com){
    class Temp extends React.Component{
      
      render(){
        // console.log(this.props)
        return <Com {...obj} {...this.props}/>
      }
    }
    return Temp
  }
}
App = connect({className:'qqq',age:100})(App);// 想把这对象中的属性给成App组建的默认参数
ReactDOM.render(<App qqq={123}/>,document.getElementById('root'))